//package com.zmn.plat.dubbo.impl.price;
//
//import com.zmn.common.dto2.ResponseDTO;
//import com.zmn.manager.common.database.annotation.ReadOnlyConnection;
//import com.zmn.plat.business.interfaces.price.ItemPriceBService;
//import com.zmn.plat.common.dto.price.ItemPriceQuery;
//import com.zmn.plat.common.dto.price.ItemTo;
//import com.zmn.plat.common.exception.PlatException;
//import com.zmn.plat.dubbo.interfaces.price.ItemPriceRemoteService;
//import com.zmn.plat.dubbo.utils.DubboConsts;
//import com.zmn.plat.model.entity.channel.product.map.ChannelProductMap;
//import com.zmn.plat.model.entity.service.tariff.ServiceTariff;
//import com.zmn.plat.services.interfaces.service.tariff.ServiceTariffService;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.dubbo.config.annotation.Service;
//
//import javax.annotation.Resource;
//import javax.validation.constraints.NotNull;
//import java.util.*;
//import java.util.stream.Collectors;
//
///**
// * 描述: 项目价格查询实现类
// *
// * @author guoqiao
// * @since 2021/9/13 17:08
// */
//@Service(version = DubboConsts.INTERFACE_VERSION, validation = "true")
//@Slf4j
//public class ItemPriceRemoteServiceImpl implements ItemPriceRemoteService {
//
//    @Resource
//    private ServiceTariffService serviceTariffService;
//    @Resource
//    private ItemPriceBService itemPriceBService;
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<Integer> getTariffTypeByID(Integer tariffId) {
//        try {
//            ServiceTariff tariff = serviceTariffService.findByKey(tariffId);
//            return ResponseDTO.success(Objects.isNull(tariff) ? null : tariff.getTariffType());
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("getTariffTypeByID查询失败,原因:{}", e.getMessage(), e);
//            return ResponseDTO.fail("查询失败，程序异常");
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ItemTo>> listItemPriceByQuery(ItemPriceQuery query) {
//        log.info("ItemPriceRemoteServiceImpl.listItemPriceByQuery：{}", query);
//        try {
//            List<ItemTo> dros = itemPriceBService.listItemPriceByQuery(query);
//            return ResponseDTO.success(dros);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listItemPriceByQuery查询失败,原因:{}", e.getMessage(), e);
//            return ResponseDTO.fail("查询失败，程序异常");
//        }
//    }
//
//    @Override
//    @ReadOnlyConnection
//    public ResponseDTO<List<ItemTo>> listItemPriceTransByQuery(ItemPriceQuery query) {
//        log.info("ItemPriceRemoteServiceImpl.listItemPriceTransByQuery：{}", query);
//        try {
//            List<ItemTo> dros = itemPriceBService.listItemPriceTransByQuery(query);
//            return ResponseDTO.success(dros);
//        } catch (PlatException e) {
//            return ResponseDTO.fromErrorCodeTable(e.getErrorCode());
//        } catch (Exception e) {
//            log.error("listItemPriceTransByQuery查询失败,原因:{}", e.getMessage(), e);
//            return ResponseDTO.fail("查询失败，程序异常");
//        }
//    }
//
//}
